home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / SH / STD / H / STDARG.H < prev    next >
C/C++ Source or Header  |  1992-07-13  |  619b  |  23 lines

  1. #ifndef _STDARG_H
  2. #define _STDARG_H
  3.  
  4. typedef char *va_list;
  5.  
  6. /* Amount of space required in an argument list for an arg of type TYPE.
  7.    TYPE may alternatively be an expression whose type is used.  */
  8.  
  9. #define __va_rounded_size(TYPE)  \
  10.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  11.  
  12. #define va_start(AP, LASTARG)                         \
  13.  (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
  14.  
  15. void va_end (va_list);        /* Defined in gnulib */
  16. #define va_end(AP)
  17.  
  18. #define va_arg(AP, TYPE)                        \
  19.  (AP += __va_rounded_size (TYPE),                    \
  20.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  21.  
  22. #endif /* _STDARG_H */
  23.